<template>
	<view>
	<view class="td-item"  v-for="(item,index) in dataList" :key="index"
	@click="goPage('/subpkg/tdContent/tdContent',{deptId:item.deptId,subUserNum:item.subUserNum,wdtd:wdtd,isMyzzId:item.Myzz.isMyzzId,shStatus:item.Myzz.shStatus})">
	
		<view class="td-desc" >
			<u--image :showLoading="true" :src="item.imgPrimary" width="125rpx" height="125rpx" shape="circle" />
			<view class="td-text">
				<view class="td-name">{{item.deptName}}</view>
				<view class="td-fzr">负责人：{{item.leaderUser.trueName?item.leaderUser.trueName:'暂无'}}</view>
				<view class="td-cyrs">成员人数：{{item.subUserNum?item.subUserNum:'0'}}</view>
			</view>
		</view>
		
		<view v-if="(!wdtd&&item.Myzz.isMyzzId==false&&item.Myzz.shStatus==5)||item.Myzz.shStatus==2">
			<u--image :showLoading="true"
			:src="require('@/static/images/tdList/addIcon.png')" width="116rpx" height="62rpx" @click.native.stop="addTd(item)"/>
			
		</view>
		<view v-if="(!wdtd&&item.Myzz.isMyzzId==true&&item.Myzz.shStatus!=5)&&item.Myzz.shStatus!=2"> 
		<view>
		<!-- {{item.Myzz.shStatus==0?'待审核':item.Myzz.shStatus==1?'审核通过':item.Myzz.shStatus==2?'审核失败':''}} -->
		<u-tag
		:text="item.Myzz.shStatus==0?'待审核':
		item.Myzz.shStatus==1?'通过':''" 
		:type="item.Myzz.shStatus==0?'warning':
		item.Myzz.shStatus==1?'success':''" 
		plain plainFill></u-tag>
		</view>
		</view>
	</view>
	</view>
</template>

<script>
	import {mapActions,mapState} from 'vuex'
	export default {
		name:"tdItem",
		props:{
			wdtd:{
				default:false,
				type:Boolean,
			},
			dataList:{
				default:[],
				type:Array
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			...mapActions('m_zzjg',['hyaddDeptAction']),
			//路由跳转
			goPage(url,obj){
				uni.$u.route(url,obj);
			},
			//加入团队
			addTd(e){
				this.$emit('addTd',{deptId:e.deptId})
				
			},
		}
	}
</script>

<style scoped lang="scss">
	
	
	.td-item{margin:30rpx;padding:34rpx;background-color: #fff;border-radius: 20px;
			display: flex;justify-content: space-between;align-items: center;
			.td-desc{
				display: flex;align-items: center;
				.td-text{margin-left:36rpx;
					.td-name{font-weight: bold;font-size:32rpx;}
					.td-fzr,.td-cyrs{color:#9a9ca0;font-size: 26rpx;}
					.td-fzr{margin:15rpx 0;}
				}
			}
	}
</style>